import matplotlib.pyplot as plt
import numpy as np

plt.figure(figsize=[16, 8])
spr = 1
spc = 2
spn = 0

spn += 1
plt.subplot(spr, spc, spn)
x = np.linspace(-1, 2, 1001)
y = lambda x: x * (1 - x)
plt.plot(x, y(x), label='gini')
plt.grid()
plt.legend()

spn += 1
plt.subplot(spr, spc, spn)
x = np.linspace(0, 1, 1001)
y = lambda x: x * (1 - x)
plt.plot(x, y(x), label='gini')
plt.grid()
plt.legend()

plt.show()
